package com.sugar.psych.assessment.module.business.dal.mysql.usertreeholechatrecord;

import java.util.*;

import com.sugar.psych.assessment.framework.common.pojo.PageResult;
import com.sugar.psych.assessment.framework.common.pojo.PageParam;
import com.sugar.psych.assessment.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.psych.assessment.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.psych.assessment.module.business.dal.dataobject.usertreeholechatrecord.UserTreeHoleChatDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 树洞AI聊天消息 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface UserTreeHoleChatMapper extends BaseMapperX<UserTreeHoleChatDO> {

    default PageResult<UserTreeHoleChatDO> selectPage(PageParam reqVO, Long recordId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserTreeHoleChatDO>()
            .eq(UserTreeHoleChatDO::getRecordId, recordId)
            .orderByDesc(UserTreeHoleChatDO::getId));
    }

    default int deleteByRecordId(Long recordId) {
        return delete(UserTreeHoleChatDO::getRecordId, recordId);
    }

	default int deleteByRecordIds(List<Long> recordIds) {
	    return deleteBatch(UserTreeHoleChatDO::getRecordId, recordIds);
	}

}
